home *** CD-ROM | disk | FTP | other *** search
/ Programmer Power Tools / Programmer Power Tools.iso / progjrn / pj_vga.arc / TESTIMER.ASM < prev    next >
Assembly Source File  |  1989-06-14  |  691b  |  38 lines

  1. ;
  2. ; *** Listing 2 ***
  3. ;
  4. ; Program to measure performance of code that takes less than
  5. ; 54 ms to execute.
  6. ;
  7. ; Link with Listing 1.
  8. ;
  9. stack    segment    para stack 'STACK'
  10.     db    512 dup(?)
  11. stack    ends
  12.  
  13. Code    segment    para public 'CODE'
  14.     assume    cs:Code, ds:code
  15.     extrn    TimerOn:near, TimerOff:near, TimerReport:near
  16. Start    proc    near
  17. ; Start the timer.
  18.     call    TimerOn
  19. ; ***** Code to be measured starts here *****
  20.     rept    1000
  21.     shr    dx,1
  22.     shr    dx,1
  23.     shr    dx,1
  24.     add    ax,dx
  25.     endm
  26. ; ***** Code to be measured ends here *****
  27. ;
  28. ; Stop the timer.
  29.     call    TimerOff
  30. ; Display the results.
  31.     call    TimerReport
  32. ; Terminate the program.
  33.     mov    ah,4ch
  34.     int    21h
  35. Start    endp
  36. Code    ends
  37.     end    Start
  38.